﻿namespace SimpleWebServices.Reflection
{
    using System;
    using System.Reflection;

    public static class MemberInfoExtensionMethods
    {
        public static bool HasAttribute(this MemberInfo property, Type expected)
        {
            if (null == property)
            {
                throw new ArgumentNullException("property");
            }

            if (null == expected)
            {
                throw new ArgumentNullException("expected");
            }

            return null != Attribute.GetCustomAttribute(property, expected, true);
        }
    }
}